package com.hefu.virtuallife.ui.foods.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.hefu.virtuallife.baseui.BaseFragment;
import com.hefu.virtuallife.ui.foods.fragment.MyFoodPlanFragment;

import java.util.List;

/**
 *creat_user: zhengzaihong
 *email:1096877329@qq.com
 *creat_date: 2018/8/11
 *creat_time: 13:58
 *describe: 美食适配器
 **/
public class MyMenuePageAdapter extends FragmentPagerAdapter {

    private List<BaseFragment> fragments;

    public MyMenuePageAdapter(FragmentManager fm, List<BaseFragment> fragments) {
        super(fm);
        this.fragments = fragments;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return fragments.get(position).getTitlefragment();
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }
    @Override
    public int getCount() {
        return fragments.size();
    }

}
